package com.stand.hardcode.util;

public class Sanitizer {
   
	public static String sanitize(String value) {
    if (value != null) {
    value = value.replaceAll("<", "&lt;").replaceAll(">", "&gt;");
    value = value.replaceAll("\\(", "&#40;").replaceAll("\\)", "&#41;");
    value = value.replaceAll("'", "&#39;");
    value = value.replaceAll("eval\\((.*)\\)", "");
    value = value.replaceAll("[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']", "\"\"");
    }
    return value;
    }
	
	public static String sanitize(long value) {
		return sanitize(Long.toString(value));
	}
	
	public static String sanitize(int value) {
		return sanitize(Integer.toString(value));
	}
	
	public static String sanitize(double value) {
		return sanitize(Double.toString(value));
	}
}


